APP = pdfresurrect
MANPAGE = pdfresurrect.1
OBJS = main.o pdf.o
CC = @CC@
CFLAGS = @AM_CFLAGS@ $(EXTRA_CFLAGS)
LDFLAGS = @LDFLAGS@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
mandir = @mandir@
datarootdir = @datarootdir@

all: $(OBJS) $(APP)

$(APP): $(OBJS)
	$(CC) -o $@ $(OBJS) $(CFLAGS) $(LDFLAGS)

%.o: %.c
	$(CC) -o $@ -c $< $(CFLAGS)

install:
	mkdir -p $(DESTDIR)$(bindir)
	cp $(APP) $(DESTDIR)$(bindir)
	mkdir -p $(DESTDIR)$(mandir)/man1
	cp $(MANPAGE) $(DESTDIR)$(mandir)/man1

uninstall:
	rm $(DESTDIR)$(bindir)/$(APP)
	rm $(DESTDIR)$(mandir)/man1/$(MANPAGE)

clean:
	rm -rfv $(OBJS) $(APP)

distclean: clean
	rm -f Makefile
	rm -f config.log config.status

.PHONY: install uninstall clean distclean
